package org.marsson.bNav;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class ClientGame extends Game implements Runnable {

	Logger logger =Logger.getLogger(this.getClass());
		protected PlayingField mainHandle;
		BattleShip battleship;
		ClientGame(BattleShip battleship)
		{
			super("Batalha Naval",battleship);
			new Thread(this, "Game Server").start();
			this.battleship=battleship;
			PropertyConfigurator.configure("src/main/resources/log4j.properties");  
			
		}

		public void run()
		{
			if (BattleShip.soundOn()) Sound.start.play();
			
			
			
			
			
			myField.placeShips();
			battleship.serialComm.execute();
			battleship.serialComm.initwritetoport();
						
			while (demoRunning)
			{
				System.out.println("Esperando tiro adversario");
			esperaTiro();
				System.out.println("tiro recebido");
			atira();
			}
		}
	}

